Skip to content

Conversation

@lolbinarycat
Copy link
Contributor

@rustbot
Copy link
Collaborator

rustbot commented Nov 21, 2025

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 21, 2025
@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Nov 21, 2025
@GuillaumeGomez
Copy link
Member

Arf, more work for my rustdoc attribute conversion (you can see it here). T_T

Thanks in any case for the improvement! r=me once CI pass

@rust-log-analyzer

This comment has been minimized.

@lolbinarycat lolbinarycat force-pushed the rustdoc-bad-render-attr branch from 827f24c to 39b7b91 Compare November 21, 2025 21:49
@rust-log-analyzer

This comment has been minimized.

@lolbinarycat lolbinarycat force-pushed the rustdoc-bad-render-attr branch from 39b7b91 to b962f49 Compare November 22, 2025 20:47
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-20-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/rustdoc-ui/bad-render-options.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/rustdoc-ui/bad-render-options/bad-render-options.stderr`
diff of stderr:

- error: `doc(html_favicon_url)` expects a string value.
+ error: `doc(html_favicon_url)` expects a string value
2   --> $DIR/bad-render-options.rs:3:8
3    |
4 LL | #![doc(html_favicon_url)]

6    |
7    = note: `#[deny(invalid_doc_attributes)]` on by default
8 
- error: `doc(html_logo_url)` expects a string value.
+ error: `doc(html_logo_url)` expects a string value
10   --> $DIR/bad-render-options.rs:4:8
11    |
12 LL | #![doc(html_logo_url)]

13    |        ^^^^^^^^^^^^^
14 
- error: `doc(html_playground_url)` expects a string value.
+ error: `doc(html_playground_url)` expects a string value
16   --> $DIR/bad-render-options.rs:5:8
17    |
18 LL | #![doc(html_playground_url)]

19    |        ^^^^^^^^^^^^^^^^^^^
20 
- error: `doc(issue_tracker_base_url)` expects a string value.
+ error: `doc(issue_tracker_base_url)` expects a string value
22   --> $DIR/bad-render-options.rs:6:8
23    |
24 LL | #![doc(issue_tracker_base_url)]

25    |        ^^^^^^^^^^^^^^^^^^^^^^
26 
- error: `doc(html_favicon_url)` expects a string value.
+ error: `doc(html_favicon_url)` expects a string value
28   --> $DIR/bad-render-options.rs:7:8
29    |
30 LL | #![doc(html_favicon_url = 1)]

31    |        ^^^^^^^^^^^^^^^^^^^^
32 
- error: `doc(html_logo_url)` expects a string value.
+ error: `doc(html_logo_url)` expects a string value
34   --> $DIR/bad-render-options.rs:8:8
35    |
36 LL | #![doc(html_logo_url = 2)]

37    |        ^^^^^^^^^^^^^^^^^
38 
- error: `doc(html_playground_url)` expects a string value.
+ error: `doc(html_playground_url)` expects a string value
40   --> $DIR/bad-render-options.rs:9:8
41    |
42 LL | #![doc(html_playground_url = 3)]

43    |        ^^^^^^^^^^^^^^^^^^^^^^^
44 
- error: `doc(issue_tracker_base_url)` expects a string value.
+ error: `doc(issue_tracker_base_url)` expects a string value
46   --> $DIR/bad-render-options.rs:10:8
47    |
48 LL | #![doc(issue_tracker_base_url = 4)]

49    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^
50 
- error: `doc(html_no_source)` does not accept a value.
+ error: `doc(html_no_source)` does not accept a value
52   --> $DIR/bad-render-options.rs:11:8
53    |
54 LL | #![doc(html_no_source = "asdf")]


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args bad-render-options.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustdoc" "/checkout/tests/rustdoc-ui/bad-render-options.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-o" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/rustdoc-ui/bad-render-options" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Cdebuginfo=0"
stdout: none
--- stderr -------------------------------
error: `doc(html_favicon_url)` expects a string value
##[error]  --> /checkout/tests/rustdoc-ui/bad-render-options.rs:3:8
   |
LL | #![doc(html_favicon_url)] //~ ERROR: `doc(html_favicon_url)` expects a string value. [invalid_doc_attributes]
   |        ^^^^^^^^^^^^^^^^
   |
   = note: `#[deny(invalid_doc_attributes)]` on by default

error: `doc(html_logo_url)` expects a string value
##[error]  --> /checkout/tests/rustdoc-ui/bad-render-options.rs:4:8
   |
LL | #![doc(html_logo_url)] //~ ERROR: `doc(html_logo_url)` expects a string value. [invalid_doc_attributes]
   |        ^^^^^^^^^^^^^

error: `doc(html_playground_url)` expects a string value
##[error]  --> /checkout/tests/rustdoc-ui/bad-render-options.rs:5:8
   |
LL | #![doc(html_playground_url)] //~ ERROR: `doc(html_playground_url)` expects a string value. [invalid_doc_attributes]
   |        ^^^^^^^^^^^^^^^^^^^

error: `doc(issue_tracker_base_url)` expects a string value
##[error]  --> /checkout/tests/rustdoc-ui/bad-render-options.rs:6:8
   |
LL | #![doc(issue_tracker_base_url)] //~ ERROR expects a string value
   |        ^^^^^^^^^^^^^^^^^^^^^^

error: `doc(html_favicon_url)` expects a string value
##[error]  --> /checkout/tests/rustdoc-ui/bad-render-options.rs:7:8
   |
LL | #![doc(html_favicon_url = 1)] //~ ERROR expects a string value
   |        ^^^^^^^^^^^^^^^^^^^^

error: `doc(html_logo_url)` expects a string value
##[error]  --> /checkout/tests/rustdoc-ui/bad-render-options.rs:8:8
   |
LL | #![doc(html_logo_url = 2)] //~ ERROR expects a string value
   |        ^^^^^^^^^^^^^^^^^

error: `doc(html_playground_url)` expects a string value
##[error]  --> /checkout/tests/rustdoc-ui/bad-render-options.rs:9:8
   |
LL | #![doc(html_playground_url = 3)] //~ ERROR expects a string value
   |        ^^^^^^^^^^^^^^^^^^^^^^^

error: `doc(issue_tracker_base_url)` expects a string value
##[error]  --> /checkout/tests/rustdoc-ui/bad-render-options.rs:10:8
   |
LL | #![doc(issue_tracker_base_url = 4)] //~ ERROR expects a string value
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: `doc(html_no_source)` does not accept a value
##[error]  --> /checkout/tests/rustdoc-ui/bad-render-options.rs:11:8
   |
LL | #![doc(html_no_source = "asdf")] //~ ERROR `doc(html_no_source)` does not accept a value. [invalid_doc_attributes]
   |        ^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 9 previous errors
------------------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rustdoc does not warn about misuse of html render option attributes

4 participants